Page({

    /**
     * 页面的初始数据
     */
    data: {
        editTrue: false,
        showModalStatus: false,
        editText: '编辑',
        isFilterShow: !1, //品牌筛选判断
        //筛选导航
        screenPrice: '价格',
        screenBrand: '品牌',
        screenEffect: '功效',
        screenCountry: '产地',
        screenIndex:0,
        screenimgIcon:'down',
        // 品牌筛选数据
        brand_name: [{
                id: 1,
                name: '春雨',
            },
            {
                id: 2,
                name: '丽得姿',
            },
            {
                id: 3,
                name: '佑天兰',
            },
            {
                id: 4,
                name: '蒂佳婷',
            },
            {
                id: 5,
                name: '春雨',
            },
            {
                id: 6,
                name: '春雨',
            },
            {
                id: 7,
                name: '春雨',
            },
            {
                id: 8,
                name: '春雨',
            },
        ],
        brand_id: 0, //判断筛选列表第几个
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {

    },
    // 品牌筛选按钮
    brandShowFilter: function() {
        this.setData({
            isFilterShow: !this.data.isFilterShow
        });
    },
    // 顶部筛选导航
    screenClick(e) {
        this.setData({
            screenIndex: e.target.dataset.index
        })
        let index = e.currentTarget.dataset.index
        if( 4 == index){
            index = 4 , this.setData({
                screenimgIcon:'down-active'
            })
        }else if(5 == index){
            index = 5 , this.setData({
                screenimgIcon:'down-active'
            })
        }
    },
    // 品牌筛选列表选中
    screenBrandListClick(e) {
        let that = this
        let index = e.currentTarget.dataset.index;
        // console.log(index)
        that.setData({
            brand_id: index
        })
    },
    showedit: function() {
        var that = this;
        if (that.data.editTrue == true) {
            that.setData({
                editTrue: false,
                editText: '编辑'
            })

        } else {
            that.setData({
                editTrue: true,
                editText: '完成',
            })
        }
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    }
})